From 6c13b7b80f02171b865559ea0508305e9fba8346 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 24 Apr 2007 22:00:45 +0100 Subject: [PATCH] hvm: Choose correct shared_info format for 32-bit PV drivers on 64-bit Xen. Signed-off-by: K. Y. Srinivasan Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/hvm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index bf6ec538aa..bfde91ef40 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -1049,6 +1049,15 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg) break; case HVM_PARAM_CALLBACK_IRQ: hvm_set_callback_via(d, a.value); +#if defined(__x86_64__) + /* + * Since this operation is one of the very first executed + * by PV drivers on initialisation or after save/restore, it + * is a sensible point at which to sample the execution mode of + * the guest and latch 32- or 64-bit format for shared state. + */ + d->is_compat = (hvm_guest_x86_mode(current) == 4); +#endif break; } d->arch.hvm_domain.params[a.index] = a.value; -- 2.30.2